extends Node

# 测试血条尺寸的脚本
# 将此脚本添加到游戏场景中来检验血条尺寸是否正确

func _ready():
	# 延迟2秒后检查血条尺寸
	await get_tree().create_timer(2.0).timeout
	check_health_bar_sizes()

func check_health_bar_sizes():
	print("=== 血条尺寸检查 ===")
	
	# 检查玩家血条
	var player = get_tree().get_first_node_in_group("player")
	if player:
		var player_health_bar = player.get_node("HealthBar")
		if player_health_bar:
			print("玩家血条尺寸:", player_health_bar.size)
			print("玩家血条位置:", player_health_bar.position)
			print("玩家血条bar_width:", player_health_bar.bar_width)
			print("玩家血条bar_height:", player_health_bar.bar_height)
		else:
			print("未找到玩家血条节点")
	else:
		print("未找到玩家节点")
	
	# 检查敌人血条
	var enemies = get_tree().get_nodes_in_group("enemies")
	if enemies.size() > 0:
		var enemy = enemies[0]
		var enemy_health_bar = enemy.get_node("HealthBar")
		if enemy_health_bar:
			print("敌人血条尺寸:", enemy_health_bar.size)
			print("敌人血条位置:", enemy_health_bar.position)
			print("敌人血条bar_width:", enemy_health_bar.bar_width)
			print("敌人血条bar_height:", enemy_health_bar.bar_height)
		else:
			print("未找到敌人血条节点")
	else:
		print("未找到敌人节点")
	
	print("===================") 